﻿<div style="color:Black;background-color:White;"><pre>
<span style="background-color:Yellow;">&lt;%</span><span style="color:Blue;">@</span> <span style="color:#A31515;">Webhandler</span> <span style="color:Red;">Language</span><span style="color:Blue;">=</span><span style="color:Blue;">&quot;C#&quot;</span> <span style="color:Red;">CodeBehind</span><span style="color:Blue;">=</span><span style="color:Blue;">&quot;Global.asax.cs&quot;</span> <span style="color:Red;">Inherits</span><span style="color:Blue;">=</span><span style="color:Blue;">&quot;Microsoft.Foundation.Web.Global&quot;</span> <span style="background-color:Yellow;">%&gt;</span><span style="color:Blue;">bool</span> <span style="color:Blue;">public</span> <span style="color:Blue;">false</span>
</pre></div>
<br />
<div style="color:Black;background-color:White;"><pre>
<span style="background-color:Yellow;">&lt;%</span>
    <span style="color:Blue;">public</span> <span style="color:Blue;">string</span> Foo()
    {
        <span style="color:Blue;">return</span> <span style="color:#A31515;">&quot;foo&quot;</span>;
    }
<span style="background-color:Yellow;">%&gt;</span>
</pre></div>
<br />
<div style="color:Black;background-color:White;"><pre>
<span style="background-color:Yellow;">&lt;%</span>
    <span style="color:Blue;">Public</span> <span style="color:Blue;">Function</span> Foo() <span style="color:Blue;">As</span> <span style="color:Blue;">String</span>
        <span style="color:Blue;">Return</span> <span style="color:#A31515;">&quot;foo&quot;</span>
    <span style="color:Blue;">End</span> <span style="color:Blue;">Function</span>
<span style="background-color:Yellow;">%&gt;</span>
</pre></div>
<br />
<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">class</span> Foo
{
	<span style="color:Green;">// code goes here</span>
}
</pre></div>
<br />
<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">span</span> <span style="color:Red;">class</span><span style="color:Blue;">=</span><span style="color:Blue;">&quot;className&quot;</span><span style="color:Blue;">&gt;</span><span style="color:Blue;">&lt;/</span><span style="color:#A31515;">span</span><span style="color:Blue;">&gt;</span>
</pre></div>
<br />
<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">class</span> StringDemo {
    <span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">void</span> main(String[] args) {
        String palindrome = <span style="color:#A31515;">&quot;Dot saw I was Tod&quot;</span>;
    }
}
</pre></div>
<br />
<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">function</span> FunctionName(argOne, argTwo) {
    <span style="color:Blue;">return</span> argOne + argTwo;
}
</pre></div>
<br />
<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">SELECT</span> * <span style="color:Blue;">FROM</span> [TableName]
</pre></div>
<br />
<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">Public</span> <span style="color:Blue;">Class</span> Foo
	<span style="color:Green;">&#39;&#39; code goes here</span>
<span style="color:Blue;">End</span> <span style="color:Blue;">Class</span>
</pre></div>
<br />
<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">elementName</span> <span style="color:Red;">attributeName</span><span style="color:Blue;">=</span><span style="color:Black;">&quot;</span><span style="color:Blue;">attributeValue</span><span style="color:Black;">&quot;</span><span style="color:Blue;">&gt;</span>
</pre></div>
<br />
<div style="color:Black;background-color:White;"><pre>
&lt;?php
<span style="color:Green;">// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=</span>
<span style="color:Green;">// ** Test</span>
<span style="color:Green;">// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=</span>
<span style="color:Blue;">class</span> DB {
    <span style="color:Green;">// Determines whether a new link resource is created for each connection</span>
    <span style="color:Blue;">private</span> $NEW_LINK = FALSE;
    
    <span style="color:Blue;">function</span> doSomething($value) {
        <span style="color:Blue;">return</span> $value;
    }
}
?&gt;
</pre></div>
<br />
<div style="color:Black;background-color:White;"><pre>
<span style="color:#A31515;">.body </span>{ <span style="color:Red;">color</span>:<span style="color:Blue;">black</span>; }
</pre></div>
<br />
<div style="color:Black;background-color:White;"><pre>
#include &lt;iostream&gt;
<span style="color:Blue;">using</span> <span style="color:Blue;">namespace</span> std;
<span style="color:Blue;">void</span> main()
{
    cout &lt;&lt; <span style="color:#A31515;">&quot;Hello World!&quot;</span> &lt;&lt; endl;
    cout &lt;&lt; <span style="color:#A31515;">&quot;Welcome to C++ Programming&quot;</span> &lt;&lt; endl; 
}
</pre></div>
<br />
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;"># Create RTF block from text using named console colors.</span>
<span style="color:Blue;">function</span> Append<span style="color:Gray;">-</span>RtfBlock (<span style="color:OrangeRed;">$block</span>, <span style="color:OrangeRed;">$tokenColor</span>)
{
    <span style="color:OrangeRed;">$colorIndex</span> <span style="color:Gray;">=</span> <span style="color:OrangeRed;">$rtfColorMap</span>.<span style="color:OrangeRed;">$tokenColor</span>
    <span style="color:OrangeRed;">$block</span> <span style="color:Gray;">=</span> <span style="color:OrangeRed;">$block</span>.Replace(<span style="color:#A31515;">&#39;\&#39;,&#39;</span>\\&#39;).Replace(<span style="color:#A31515;">&quot;`r`n&quot;</span>,<span style="color:#A31515;">&quot;\cf1\par`r`n&quot;</span>)
    <span style="color:OrangeRed;">$block</span> <span style="color:Gray;">=</span> <span style="color:OrangeRed;">$block</span>.Replace(<span style="color:#A31515;">&quot;`t&quot;</span>,<span style="color:#A31515;">&#39;\tab&#39;</span>).Replace(<span style="color:#A31515;">&#39;{&#39;</span>,<span style="color:#A31515;">&#39;\{&#39;</span>).Replace(<span style="color:#A31515;">&#39;}&#39;</span>,<span style="color:#A31515;">&#39;\}&#39;</span>)
    <span style="color:OrangeRed;">$null</span> <span style="color:Gray;">=</span> <span style="color:OrangeRed;">$rtfBuilder</span>.Append(<span style="color:#A31515;">&quot;\cf$colorIndex $block&quot;</span>)
}
</pre></div>
<br />
<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">declare</span> <span style="color:Blue;">module</span> Test {
<span style="color:Blue;">function</span> FunctionName(argOne, argTwo) {
<span style="color:Blue;">return</span> argOne + argTwo;
}
}
</pre></div>
<br />
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">// F# Comment</span><span style="color:Blue;">type</span> Person(name:string, age:int) =<span style="color:Blue;">let</span> <span style="color:Blue;">mutable</span> internalAge = age<span style="color:Blue;">new</span>(name:string) = Person(name, 0)<span style="color:Blue;">member</span> this.Name = name<span style="color:Blue;">member</span> this.Age<span style="color:Blue;">with</span> get() = internalAge<span style="color:Blue;">and</span> set(value) = internalAge &lt;- value<span style="color:Blue;">member</span> this.HasABirthday () = internalAge &lt;- internalAge + 1<span style="color:Blue;">member</span> this.IsOfAge targetAge = internalAge &gt;= targetAge<span style="color:Blue;">override</span> this.ToString () =  <span style="color:#A31515;">&quot;Name:  &quot;</span> + name + <span style="color:#A31515;">&quot;\n&quot;</span> + <span style="color:#A31515;">&quot;Age:&quot;</span> + (string)internalAge</pre></div>
<br />
<div style="color:Black;background-color:White;"><pre><span style="color:Blue;">function</span> encode<span>(</span> s <span style="color:Teal;">: string</span><span>,</span> shift <span style="color:Teal;">: int </span><span>)</span><span>{</span>  <span style="color:Blue;">fun</span> encodeChar<span>(</span>c<span>)</span> <span>{</span><span style="color:Blue;">if</span> <span>(</span>c <span>&lt;</span> <span style="color:#A31515;">&#39;a&#39;</span> <span>||</span> c <span>&gt;</span> <span style="color:#A31515;">&#39;z&#39;</span><span>)</span> <span style="color:Blue;">return</span> cbase <span style="color:Blue;">=</span> <span>(</span>c <span>-</span> <span style="color:#A31515;">&#39;a&#39;</span><span>)</span><span style="color:Blue;">.</span>int  rot  <span style="color:Blue;">=</span> <span>(</span>base <span>+</span> shift<span>)</span> <span>%</span> <span>26</span><span style="color:Blue;">return</span> <span>(</span>rot<span style="color:Blue;">.</span>char <span>+</span> <span style="color:#A31515;">&#39;a&#39;</span><span>)</span>  <span>}</span>  s<span style="color:Blue;">.</span>map<span>(</span>encodeChar<span>)</span><span>}</span><span style="color:Blue;">function</span> caesar<span>(</span> s <span style="color:Teal;">: string </span><span>)</span> <span style="color:Teal;">: string</span><span>{</span>  s<span style="color:Blue;">.</span>encode<span>(</span> <span>3</span> <span>)</span><span>}</span></pre></div>
<br />
<div style="color:Black;background-color:White;"><pre><span style="color:Green;">-- Type annotation (optional)</span>factorial <span style="color:Teal;">:: Integer -&gt; Integer</span> <span style="color:Green;">-- Using recursion</span>factorial <span>0</span> <span style="color:Blue;">=</span> <span>1</span>factorial n <span style="color:Blue;">|</span> n <span>&gt;</span> <span>0</span> <span style="color:Blue;">=</span> n * factorial <span>(</span>n <span>-</span> <span>1</span><span>)</span> <span style="color:Green;">-- Using recursion but written without pattern matching</span>factorial n <span style="color:Blue;">=</span> <span style="color:Blue;">if</span> n <span>&gt;</span> <span>0</span> <span style="color:Blue;">then</span> n * factorial <span>(</span>n<span>-</span><span>1</span><span>)</span> <span style="color:Blue;">else</span> <span>1</span> <span style="color:Green;">-- Using a list</span>factorial n <span style="color:Blue;">=</span> product <span>[</span><span>1</span><span style="color:Blue;">..</span>n<span>]</span> <span style="color:Green;">-- Using fold (implements product)</span>factorial n <span style="color:Blue;">=</span> foldl1 <span>(</span>*<span>)</span> <span>[</span><span>1</span><span style="color:Blue;">..</span>n<span>]</span> <span style="color:Green;">-- Point-free style</span>factorial <span style="color:Blue;">=</span> foldr <span>(</span>*<span>)</span> <span>1</span> <span>.</span> enumFromTo <span>1</span> <span style="color:Green;">-- Point-free style analytic solution</span><span style="color:Blue;">import</span> <span style="color:Navy;">Math.Gamma</span>factorial <span style="color:Blue;">=</span> round <span>.</span> exp <span>.</span> lnGamma <span>.</span> fromIntegral <span>.</span> <span>(</span><span>+</span><span>1</span><span>)</span></pre></div>
<br />
<div style="color:Black;background-color:White;"><pre><span style="font-weight: bold;"># Hello</span><span style="font-weight: bold;">*</span>world*<span style="font-weight: bold;">*</span><span style="font-weight: bold;">*!!!*</span>*</pre></div>